using System;
using System.Collections.Generic;
using NHibernate.Search.Attributes;
using NHibernate.Search;

namespace Ic.Model
{
	#region Band

	/// <summary>
	/// Band object for NHibernate mapped table 'TB_Band'.
	/// </summary>
	[Serializable]
	[TableInfo(TableName = "TB_Band", PrimaryKey = "Id" , Columns="Id,BandName,BandLogo,BandCompany,BandGenre,BandStyle,BandDesc,BandCreatorUid,RegDate,UpdateDate")]
	[Indexed(Index = "Band")] 
	public class Band
	{
		#region Member Variables
		
		protected int _id;
		protected string _bandName;
		protected string _bandLogo;
		protected string _bandCompany;
		protected string _bandGenre;
		protected string _bandStyle;
		protected string _bandDesc;
		protected DateTime _regDate;
		protected DateTime _updateDate;
		protected BandUser _bandCreatorUid;
		/*protected IList<BandMember> _bandTBBandMembers;*/

		#endregion

		#region Constructors

		public Band() { }

		public Band( string bandName, string bandLogo, string bandCompany, string bandGenre, string bandStyle, string bandDesc, DateTime regDate, DateTime updateDate, BandUser bandCreatorUid )
		{
			this._bandName = bandName;
			this._bandLogo = bandLogo;
			this._bandCompany = bandCompany;
			this._bandGenre = bandGenre;
			this._bandStyle = bandStyle;
			this._bandDesc = bandDesc;
			this._regDate = regDate;
			this._updateDate = updateDate;
			this._bandCreatorUid = bandCreatorUid;
		}

		#endregion

		#region Public Properties

		[DocumentId]
		public virtual int Id
		{
			get {return _id;}
			set {_id = value;}
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string BandName
		{
			get { return _bandName; }
			set
			{
				if ( value != null && value.Length > 200)
					throw new ArgumentOutOfRangeException("Invalid value for BandName", value, value.ToString());
				_bandName = value;
			}
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string BandLogo
		{
			get { return _bandLogo; }
			set
			{
				if ( value != null && value.Length > 200)
					throw new ArgumentOutOfRangeException("Invalid value for BandLogo", value, value.ToString());
				_bandLogo = value;
			}
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string BandCompany
		{
			get { return _bandCompany; }
			set
			{
				if ( value != null && value.Length > 50)
					throw new ArgumentOutOfRangeException("Invalid value for BandCompany", value, value.ToString());
				_bandCompany = value;
			}
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string BandGenre
		{
			get { return _bandGenre; }
			set
			{
				if ( value != null && value.Length > 200)
					throw new ArgumentOutOfRangeException("Invalid value for BandGenre", value, value.ToString());
				_bandGenre = value;
			}
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string BandStyle
		{
			get { return _bandStyle; }
			set
			{
				if ( value != null && value.Length > 200)
					throw new ArgumentOutOfRangeException("Invalid value for BandStyle", value, value.ToString());
				_bandStyle = value;
			}
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string BandDesc
		{
			get { return _bandDesc; }
			set
			{
				_bandDesc = value;
			}
		}

		public virtual DateTime RegDate
		{
			get { return _regDate; }
			set { _regDate = value; }
		}

		public virtual DateTime UpdateDate
		{
			get { return _updateDate; }
			set { _updateDate = value; }
		}

		public virtual BandUser BandCreatorUid
		{
			get { return _bandCreatorUid; }
			set { _bandCreatorUid = value; }
		}

		public virtual IList<BandMember> BandTB_BandMembers
		{
			get;set;
			#region remove
			/*
			get
			{
				if (_bandTBBandMembers==null)
				{
					_bandTBBandMembers = new List<BandMember>();
				}
				return _bandTBBandMembers;
			}
			set { _bandTBBandMembers = value; }
			*/
			#endregion
		}

		

		#endregion
	}
	#endregion
}